package edu.scau.divineplace.controller;

import edu.scau.divineplace.config.global.log.WebLog;
import edu.scau.divineplace.entity.query.PageQuery;
import edu.scau.divineplace.entity.vo.JournalVO;
import edu.scau.divineplace.service.JouanlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @Author: x1aolone
 * @Date: 2020/12/11 15:47
 */
@Slf4j
@RestController
@CrossOrigin
@Api("Journal控制器")
@WebLog("Journal控制器")
@RequestMapping("/journal")
public class JournalController {

    @Autowired
    private JouanlService jouanlService;

    @ApiOperation("通过用户Id获取用户写的评论，支持分页")
    @GetMapping("/list/{userId}")
    public List<JournalVO> list(@PathVariable Long userId, PageQuery pageQuery){
        return jouanlService.list(userId, pageQuery);
    }

}
